
using System;
using QdbUnit.Extensions;

namespace Qdb.Tests.Common.Assorted
{
	public class UnavailableClassTestCaseBase : AbstractQdbTestCase
	{
		public UnavailableClassTestCaseBase() : base()
		{
		}

		/// <exception cref="System.Exception"></exception>
		protected virtual void ReopenHidingClasses(Type[] classes)
		{
			CloseAndResetConfig();
			Fixture().Config().ReflectWith(new ExcludingReflector(classes));
			Open();
		}

		/// <exception cref="System.Exception"></exception>
		private void Open()
		{
			Fixture().Open(this);
		}

		/// <exception cref="System.Exception"></exception>
		private void CloseAndResetConfig()
		{
			Fixture().Close();
			Fixture().ResetConfig();
		}
	}
}
